{% extends 'base.html' %}

{% block content %}
<div id='searchdiv'>
	<h3> Search for Things: </h3>
	<form action="/search">
<!-- 			<label>Search for Things:</label><br/> -->
		<table id='searchformtable'>
		  <tr>
			<td><input type="text" name="q" id='q'/></td><td><input id='searchinput' type="submit" value="Search"/></td></tr>
			<td><a href="/advanced_search" class='discrete_link'>[Advanced Search]</a></td><td></td></tr>
		</table>

	</form>
</div>
<div style="width:100%">
	<div>
		<h3>Recently Added</h3>
		<ul>
		{% for product in products %}
		<li><a href='products{{ product.slug }}'> {{ product.name }} </a></li>

		{% endfor %}
		</ul>
	</div>
	<div>
	<h3>Recent Ratings</h3>
	<ul>
		{% for product, author, date in recent_pair %}
		<li><a href='products{{ product.slug }}'>{{product}}</a> by <a href="/user/{{author}}">{{author}}</a> on {{date}}</li>
		{% endfor %}
	</ul>
	</div>
</div>
<hr/>
<div style="float:clear; display:block"></div>
<script src="/site_media/js/facebook.js" type="text/javascript"></script>
    <script>
    facebookAppId = '{{ FACEBOOK_APP_ID }}';
    function facebookJSLoaded(){
    FB.init({appId: facebookAppId, status: false, cookie: true, xfbml: true, oauth: true});
    }
    window.fbAsyncInit = facebookJSLoaded;
    F = new facebookClass(facebookAppId);
    F.load();
</script>

<div style="width:100%">
	<center>

	<div style="width:300px; background-color: #4b7f92; border: #4b7f92; ">
	<form action="{% url facebook_connect %}?facebook_login=1" method="post">
		<input type="hidden" value="{{ request.path }}" name="next" />

		<!--
		use error next for a seperate error page
		<input type="hidden" value="/error/" name="error_next" />
		-->

		<iframe src="http://www.facebook.com/plugins/facepile.php?app_id={{ FACEBOOK_APP_ID }}&amp;width=500&amp;max_rows=1" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe>
		<input type="image" src="http://e.fashiocdn.com/images/b_signin_facebook_small.png" />
	</form>
	</div>
	<div style="float:right" class="fb-like" data-href="http://www.pythonkursu.com" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>
	</center>
</div>

{% endblock %}

